<?php

/**
 * This is the model class for table "sq_idiom".
 *
 * The followings are the available columns in table 'sq_idiom':
 * @property integer $Id
 * @property string $C_Char
 * @property string $Py_Char
 * @property string $FirstLetter
 * @property string $LastLetter
 * @property string $FirstChar
 * @property string $LastChar
 * @property integer $Created
 * @property integer $Updated
 * @property string $Unikey
 */
class Idiom extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return Idiom the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sq_idiom';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('Created, Updated', 'numerical', 'integerOnly'=>true),
			array('C_Char, Py_Char, Unikey', 'length', 'max'=>100),
			array('FirstLetter, LastLetter, FirstChar, LastChar', 'length', 'max'=>10),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('Id, C_Char, Py_Char, FirstLetter, LastLetter, FirstChar, LastChar, Created, Updated, Unikey', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'Id' => 'ID',
			'C_Char' => 'C Char',
			'Py_Char' => 'Py Char',
			'FirstLetter' => 'First Letter',
			'LastLetter' => 'Last Letter',
			'FirstChar' => 'First Char',
			'LastChar' => 'Last Char',
			'Created' => 'Created',
			'Updated' => 'Updated',
			'Unikey' => 'Unikey',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('Id',$this->Id);
		$criteria->compare('C_Char',$this->C_Char,true);
		$criteria->compare('Py_Char',$this->Py_Char,true);
		$criteria->compare('FirstLetter',$this->FirstLetter,true);
		$criteria->compare('LastLetter',$this->LastLetter,true);
		$criteria->compare('FirstChar',$this->FirstChar,true);
		$criteria->compare('LastChar',$this->LastChar,true);
		$criteria->compare('Created',$this->Created);
		$criteria->compare('Updated',$this->Updated);
		$criteria->compare('Unikey',$this->Unikey,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}